import { Body, Controller, Post, HttpCode, HttpStatus } from '@nestjs/common'
import { AuthService } from './auth.service'
import { Public } from './public.decorator'

@Controller('auth')
export class AuthController {
  constructor(private authService: AuthService) {}

  @Public()
  @HttpCode(HttpStatus.OK)
  @Post('/login')
  async signIn(@Body() data: any) {
    return this.authService.signIn(data)
  }

  @Public()
  @Post('/register')
  async register(@Body() data: any) {
    return this.authService.register(data)
  }
}
